import getState from "@/api/state";
import ColoredDots from "@/template/ColoredDots/ColoredDots";
import ColumnColored from "@/template/columnColored/columnColored";
import HorizontalBarChart from "@/template/HorizontalBarChart/HorizontalBarChart";
import React from "react";
import { useEffect } from "react";
import { useState } from "react";

const Base5 = ({ condition }) => {
    const [message, setMessage] = useState("暂无数据");
    const [loading, setLoading] = useState(true);
    const [state, setState] = useState({
        data: []
    })


    useEffect(() => {
        getState({
            apiUrl: "/cifgp-core-api/baseQuery/pieChart",
            state,
            condition: { ...condition, cType: "baseCertType" },
            setState,
            setLoading,
            setMessage
        })
    }, [condition])


    return (
        <>
            <HorizontalBarChart
                message={message}
                loading={loading}
                sort={"up"}
                style={{ width: "25%", height: "250px" }}
                title="证件类型分布"
                hideBtn
                data={[
                    state
                ]}
               fieldNames={{
                name:"",
                value:"个"
               }}

            />
        </>
    )
}
export default Base5;